|
2000W / 48V LLC Battery-Charger
V1.00
|
General Purpose Input Output (GPIO) driver for the XMC microcontroller family. More...
|
Macros | |
| #define | PORT_IOCR_PC_Pos PORT0_IOCR0_PC0_Pos |
| #define | PORT_IOCR_PC_Msk PORT0_IOCR0_PC0_Msk |
| #define | PORT_IOCR_PC_Size (8U) |
| #define | XMC_GPIO_CHECK_OUTPUT_LEVEL(level) |
| #define | XMC_GPIO_CHECK_HWCTRL(hwctrl) |
Typedefs | |
| typedef enum XMC_GPIO_OUTPUT_LEVEL | XMC_GPIO_OUTPUT_LEVEL_t |
| typedef enum XMC_GPIO_HWCTRL | XMC_GPIO_HWCTRL_t |
Enumerations | |
| enum | XMC_GPIO_OUTPUT_LEVEL { XMC_GPIO_OUTPUT_LEVEL_LOW = 0x10000U, XMC_GPIO_OUTPUT_LEVEL_HIGH = 0x1U } |
| enum | XMC_GPIO_HWCTRL { XMC_GPIO_HWCTRL_DISABLED = 0x0U, XMC_GPIO_HWCTRL_PERIPHERAL1 = 0x1U, XMC_GPIO_HWCTRL_PERIPHERAL2 = 0x2U } |
Functions | |
| void | XMC_GPIO_Init (XMC_GPIO_PORT_t *const port, const uint8_t pin, const XMC_GPIO_CONFIG_t *const config) |
| void | XMC_GPIO_SetMode (XMC_GPIO_PORT_t *const port, const uint8_t pin, const XMC_GPIO_MODE_t mode) |
| __STATIC_INLINE void | XMC_GPIO_SetOutputLevel (XMC_GPIO_PORT_t *const port, const uint8_t pin, const XMC_GPIO_OUTPUT_LEVEL_t level) |
| __STATIC_INLINE void | XMC_GPIO_SetOutputHigh (XMC_GPIO_PORT_t *const port, const uint8_t pin) |
| __STATIC_INLINE void | XMC_GPIO_SetOutputLow (XMC_GPIO_PORT_t *const port, const uint8_t pin) |
| __STATIC_INLINE void | XMC_GPIO_ToggleOutput (XMC_GPIO_PORT_t *const port, const uint8_t pin) |
| __STATIC_INLINE uint32_t | XMC_GPIO_GetInput (XMC_GPIO_PORT_t *const port, const uint8_t pin) |
| __STATIC_INLINE void | XMC_GPIO_EnablePowerSaveMode (XMC_GPIO_PORT_t *const port, const uint8_t pin) |
| __STATIC_INLINE void | XMC_GPIO_DisablePowerSaveMode (XMC_GPIO_PORT_t *const port, const uint8_t pin) |
| void | XMC_GPIO_SetHardwareControl (XMC_GPIO_PORT_t *const port, const uint8_t pin, const XMC_GPIO_HWCTRL_t hwctrl) |
| __STATIC_INLINE void | XMC_GPIO_EnableDigitalInput (XMC_GPIO_PORT_t *const port, const uint8_t pin) |
| __STATIC_INLINE void | XMC_GPIO_DisableDigitalInput (XMC_GPIO_PORT_t *const port, const uint8_t pin) |
General Purpose Input Output (GPIO) driver for the XMC microcontroller family.
GPIO driver provide a generic and very flexible software interface for all standard digital I/O port pins. Each port slice has individual interfaces for the operation as General Purpose I/O and it further provides the connectivity to the on-chip periphery and the control for the pad characteristics.
The driver is divided into Input and Output mode.
Input mode features:
Output mode features:
| #define PORT_IOCR_PC_Msk PORT0_IOCR0_PC0_Msk |
Definition at line 98 of file xmc_gpio.h.
Referenced by XMC_GPIO_Init(), and XMC_GPIO_SetMode().
| #define PORT_IOCR_PC_Pos PORT0_IOCR0_PC0_Pos |
Definition at line 97 of file xmc_gpio.h.
| #define PORT_IOCR_PC_Size (8U) |
Definition at line 100 of file xmc_gpio.h.
Referenced by XMC_GPIO_Init(), and XMC_GPIO_SetMode().
| #define XMC_GPIO_CHECK_HWCTRL | ( | hwctrl | ) |
Definition at line 106 of file xmc_gpio.h.
Referenced by XMC_GPIO_SetHardwareControl().
| #define XMC_GPIO_CHECK_OUTPUT_LEVEL | ( | level | ) |
Definition at line 103 of file xmc_gpio.h.
Referenced by XMC_GPIO_SetOutputLevel().
| typedef enum XMC_GPIO_HWCTRL XMC_GPIO_HWCTRL_t |
Defines direct hardware control characteristics of the pin . Use type XMC_GPIO_HWCTRL_t for this enum.
| typedef enum XMC_GPIO_OUTPUT_LEVEL XMC_GPIO_OUTPUT_LEVEL_t |
Defines output level of a pin. Use type XMC_GPIO_OUTPUT_LEVEL_t for this enum.
| enum XMC_GPIO_HWCTRL |
Defines direct hardware control characteristics of the pin . Use type XMC_GPIO_HWCTRL_t for this enum.
Definition at line 127 of file xmc_gpio.h.
Defines output level of a pin. Use type XMC_GPIO_OUTPUT_LEVEL_t for this enum.
| Enumerator | |
|---|---|
| XMC_GPIO_OUTPUT_LEVEL_LOW | Reset bit |
| XMC_GPIO_OUTPUT_LEVEL_HIGH | Set bit |
Definition at line 118 of file xmc_gpio.h.
| __STATIC_INLINE void XMC_GPIO_DisableDigitalInput | ( | XMC_GPIO_PORT_t *const | port, |
| const uint8_t | pin | ||
| ) |
| port | constant pointer pointing to GPIO port, to access hardware register Pn_PDISC. |
| pin | port pin number. |
Definition at line 458 of file xmc_gpio.h.
| __STATIC_INLINE void XMC_GPIO_DisablePowerSaveMode | ( | XMC_GPIO_PORT_t *const | port, |
| const uint8_t | pin | ||
| ) |
| port | constant pointer pointing to GPIO port, to access hardware register Pn_PPS. |
| pin | port pin number. |
Definition at line 390 of file xmc_gpio.h.
| __STATIC_INLINE void XMC_GPIO_EnableDigitalInput | ( | XMC_GPIO_PORT_t *const | port, |
| const uint8_t | pin | ||
| ) |
| port | constant pointer pointing to GPIO port, to access hardware register Pn_PDISC. |
| pin | port pin number. |
Definition at line 435 of file xmc_gpio.h.
| __STATIC_INLINE void XMC_GPIO_EnablePowerSaveMode | ( | XMC_GPIO_PORT_t *const | port, |
| const uint8_t | pin | ||
| ) |
| port | constant pointer pointing to GPIO port, to access hardware register Pn_PPS. |
| pin | port pin number. |
Note:
Do not enable the Pin Power Save function for pins configured for Hardware Control (Pn_HWSEL.HWx != 00B). Doing so may result in an undefined behavior of the pin when the device enters the Deep Sleep state.
Definition at line 361 of file xmc_gpio.h.
| __STATIC_INLINE uint32_t XMC_GPIO_GetInput | ( | XMC_GPIO_PORT_t *const | port, |
| const uint8_t | pin | ||
| ) |
| port | constant pointer pointing to GPIO port, to access hardware register Pn_IN. |
| pin | Port pin number. |
Definition at line 333 of file xmc_gpio.h.
Referenced by L0_Read_LowLine(), L0_Read_Umschalter(), and L0_Read_Wahl_Schalter().

| void XMC_GPIO_Init | ( | XMC_GPIO_PORT_t *const | port, |
| const uint8_t | pin, | ||
| const XMC_GPIO_CONFIG_t *const | config | ||
| ) |
| port | Constant pointer pointing to GPIO port, to access port registers like Pn_OUT,Pn_OMR,Pn_IOCR etc. |
| pin | Port pin number. |
| config | GPIO configuration data structure. Refer data structure XMC_GPIO_CONFIG_t for details. |
Definition at line 69 of file xmc1_gpio.c.
Referenced by L0_GPIO_Config().

| void XMC_GPIO_SetHardwareControl | ( | XMC_GPIO_PORT_t *const | port, |
| const uint8_t | pin, | ||
| const XMC_GPIO_HWCTRL_t | hwctrl | ||
| ) |
| port | constant pointer pointing to GPIO port, to access hardware register Pn_HWSEL. |
| pin | port pin number. |
| hwctrl | direct hardware control selection. Refer XMC_GPIO_HWCTRL_t for valid values. |
Definition at line 74 of file xmc_gpio.c.
| void XMC_GPIO_SetMode | ( | XMC_GPIO_PORT_t *const | port, |
| const uint8_t | pin, | ||
| const XMC_GPIO_MODE_t | mode | ||
| ) |
| port | Constant pointer pointing to GPIO port, to access hardware register Pn_IOCR. |
| pin | Port pin number. |
| mode | input / output functionality selection. Refer XMC_GPIO_MODE_t for valid values. |
Definition at line 65 of file xmc_gpio.c.
| __STATIC_INLINE void XMC_GPIO_SetOutputHigh | ( | XMC_GPIO_PORT_t *const | port, |
| const uint8_t | pin | ||
| ) |
| port | constant pointer pointing to GPIO port, to access hardware register Pn_OMR. |
| pin | Port pin number. |
Definition at line 256 of file xmc_gpio.h.
Referenced by IRQ21_Handler(), L0_Eeprom_Disable_ChipSelect(), L0_Switch_Bms(), L0_Switch_LED_Anzeige(), L0_Switch_LED_Wahl_Schalter(), L0_Switch_Power(), and L0_Switch_Verpolschutz().

| __STATIC_INLINE void XMC_GPIO_SetOutputLevel | ( | XMC_GPIO_PORT_t *const | port, |
| const uint8_t | pin, | ||
| const XMC_GPIO_OUTPUT_LEVEL_t | level | ||
| ) |
| port | Constant pointer pointing to GPIO port, to access hardware register Pn_OMR. |
| pin | Port pin number. |
| level | output level selection. Refer XMC_GPIO_OUTPUT_LEVEL_t for valid values. |
Definition at line 229 of file xmc_gpio.h.
| __STATIC_INLINE void XMC_GPIO_SetOutputLow | ( | XMC_GPIO_PORT_t *const | port, |
| const uint8_t | pin | ||
| ) |
| port | constant pointer pointing to GPIO port, to access hardware register Pn_OMR. |
| pin | port pin number. |
Definition at line 282 of file xmc_gpio.h.
Referenced by IRQ21_Handler(), L0_Eeprom_Enable_ChipSelect(), L0_Switch_Bms(), L0_Switch_LED_Anzeige(), L0_Switch_LED_Wahl_Schalter(), L0_Switch_Power(), and L0_Switch_Verpolschutz().

| __STATIC_INLINE void XMC_GPIO_ToggleOutput | ( | XMC_GPIO_PORT_t *const | port, |
| const uint8_t | pin | ||
| ) |
| port | constant pointer pointing to GPIO port, to access hardware register Pn_OMR. |
| pin | port pin number. |
Definition at line 308 of file xmc_gpio.h.